import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/employment',
      component: () => import('../views/Employment/index.vue')
    },
    {
      path: '/equipment',
      component: () => import('../views/Equipment/index.vue')
    },
    {
      path: '/home',
      component: () => import('../views/Home/index.vue')
    },
    {
      path: '/security',
      component: () => import('../views/Security/index.vue')
    }
  ]
})

// import getPaths from '@/utils/getPaths'

// router.beforeEach((to,from)=>{
//   if(to.path!='/login'){
//     const token=localStorage.getItem('token')
//     if(!token){
//       return {
//         path:'/login'
//       }
//     }

//   }
// })

export default router
